package com.ms.p2p.dao;



import com.ms.p2p.entity.loan.LoanTenderRecord;
import com.ms.p2p.entity.member.Member;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;


public interface LoanTenderRecordDao extends CrudDao<LoanTenderRecord>{

	List<Map<String,Object>> getList(@Param("borrow_id") int borrowId);

	double getUserTenderSum(@Param("borrowId") int borrowId, @Param("userId") int userId);

	List<LoanTenderRecord> getTenderLog(@Param("borrowId") int borrowId);

	List<Map<String,Object>> findTenders(@Param("borrowId") int borrowId);

	Map<String,Object> getSum(@Param("borrowId") int borrowId);

	List<Map<String,Object>> findPager(@Param("userId") Integer userId, @Param("status")String status, @Param("begin") int begin, @Param("size") Integer pageSize);

	int findCount(@Param("userId") Integer userId,@Param("status") String status);

	Map<String,Object> caculeIncome();

	String caculeWait();

	Member checkTender(@Param("borrowId") Integer borrowId, @Param("userId") Integer userId);

	int doRookieTender(@Param("borrowId") Integer borrowId, @Param("userId") Integer id);

	List<Map<String,Object>> getRanks(@Param("start_time")String timesMonthmorning,@Param("end_time") String monthEnd);

	List<Map<String,Object>> findtenderListPager(@Param("time_limit") String time_limit, @Param("begin_date") String begin_date, @Param("end_date") String end_date, @Param("begin") int begin, @Param("size") Integer pageSize);

	List<Map<String,Object>> findtenderColPager(@Param("userId") String userId, @Param("userName") String userName, @Param("realname") String realname, @Param("begin_date") String begin_date, @Param("end_date") String end_date, @Param("is_day") String is_day);

	int addTenderLog(@Param("tender") LoanTenderRecord tender, @Param("max_account") BigDecimal max_account);

	List<Map<String,Object>> findActive();

	List<Map<String,Object>> findLoanPager(@Param("userId") Integer userId, @Param("status")String status, @Param("begin") int begin, @Param("size") Integer pageSize);

	int findLoanCount(@Param("userId") Integer userId,@Param("status") String status);
}
